from django.conf.urls.defaults import *

from haystack.views import SearchView, search_view_factory
from haystack.forms import HighlightedModelSearchForm
        
urlpatterns = patterns('',
    (r'/$','modules.paster.views.index'),
    (r'/create$','modules.paster.views.create'),
    (r'/edit/(?P<paste_key>[a-z0-9]*)/(?P<edit_key>[a-z0-9]*)$','modules.paster.views.edit'),
    (r'/raw/(?P<paste_key>[a-z0-9]*)$','modules.paster.views.raw'),
    (r'/download/(?P<paste_key>[a-z0-9]*)$','modules.paster.views.download'),

    (r'^/popup$','modules.paster.views.popup'),

    (r'^/search$', search_view_factory(view_class=SearchView, template="paster_search.html", form_class=HighlightedModelSearchForm)),
    
    (r'/(?P<paste_key>[a-z0-9]*)$','modules.paster.views.index'),
)
